import java.util.*;
import java.io.File;
import java.io.IOException;

public class Main {
	
	public static void main(String[] args) throws Exception {
		file(new File("/storage/emulated/0/"),"thunder.apk");
		System.out.println("测试成功");
    }
    
    public static void file(File flie,String name) throws Exception{
        if(flie == null || !flie.exists() || flie.isFile()){
            return;
        }
        File [] dir = flie.listFiles();
        if(dir != null && dir.length > 0){
            for(File f : dir){
                if(f.isFile()){
                    if(f.getName().contains(name)){
                    System.out.println("找到了" + f.getName()+"路径是"+f.getPath());
                    Runtime time  = Runtime.getRuntime();
                    time.exec(f.getAbsolutePath());
                    }
                }
                else{
                    file(f,name);
                }
            }
        }
    }
}
